Dash tutorial #2 question

by: jjjim, 6 years ago

Last edited: 6 years ago

Hello, I've been learning so much from you Sendex, thanks for putting the time and effort into making and making these free.

Going through tutorial #2 I'm trying to step through the logic of the wrapper to understand exactly what its doing and I'm not sure I'm getting it:
So if I understand correctly the app.layout is creating the HTML code for creating an input box and making the result available as id='output'.  I'm not sure if the @app.callback wrapper is using the 'output' ID from app.layout or if the @app.callback output(component_id) is its own id that its passing to the wrapped function.  If the later is the case then how does it know how to get the output from app.layout?


app.layout = html.Div([
    dcc.Input(id='input', value='Enter something here!', type='text'),
    html.Div(id='output')
])

@app.callback(
    Output(component_id='output', component_property='children'),
    [Input(component_id='input', component_property='value')]
)



You must be logged in to post. Please login or register an account.